package com.movie.service.Impl;

import com.movie.beans.SysUser;
import com.movie.dao.UserDAO;
import com.movie.service.UserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * 用户 业务层实现
 *
 * @author nlw
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDAO userDAO;

    /**
     * 重置密码
     * @Params [sysUser]
     * @return int
    */
    @Override
    public int resetUserPwd(SysUser sysUser) {
        return userDAO.updateUser(sysUser);
    }

    /**
     * 更新用户信息
     * @Params [sysUser]
     * @return int
    */
    @Override
    public int updateUser(SysUser sysUser) {
        return userDAO.updateUser(sysUser);
    }

    /**
     * 根据userId查询用户
     * @Params [userId]
     * @return com.sdust.beans.SysUser
     * @Author nlw
     * @date 2021/8/26
    */
    @Override
    public SysUser selectUserById(Long userId) {
        return userDAO.selectUserById(userId);
    }

    @Override
    public int insert(SysUser sysUser) {
        return userDAO.insert(sysUser);
    }

    @Override
    public int remove(Long userId) {
        return userDAO.remove(userId);
    }

    @Override
    public List<SysUser> selectUserBySearchVal(String searchVal) {
        return userDAO.selectUserBySearchVal(searchVal);
    }

    @Override
    public SysUser selectUserByName(SysUser sysUser) {
        return userDAO.selectUserByName(sysUser);
    }
}
